﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Excuse.Infrastructure;
using Excuse.Models;
using Resources;
using WebMatrix.WebData;

namespace Excuse.Controllers
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            ViewBag.Message = ApplicationLabels.HelloLabel;
            
            return View();
        }

        public ActionResult Service()
        {
            ViewBag.Message = ApplicationLabels.HelloLabel;

            return View();
        }

        [CustomAuthorize(Roles = "Administrator")] 
        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            var context = new UsersContext();
            var username = User.Identity.Name;
            var user = context.UserProfiles.SingleOrDefault(u => u.UserName == username);
            var l = user.License;

            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
